<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <style>
        input{
            text-align: center;
        }
    </style>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">智</h1>

            </div>
            <h3>欢迎使用 教师管理后台</h3>

            <form class="m-t" id="form">
                <div class="form-group">
                    <input type="text" class="form-control" name="phone" placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" name="password" placeholder="密码" required="">
                </div>
                <button type="button" onclick="denglu()" class="btn btn-primary block full-width m-b dim">登 录</button>
                <button type="button" onclick="window.location.href='zhuce.html'" class="btn btn-primary block full-width m-b dim">前往注册</button>

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <!-- Toastr script -->
    <script src="js/plugins/toastr/toastr.min.js"></script>

    <script src="js/zhangyue5.4.js"></script>

    

</body>
<script>
    const denglu = function(){
        let input = ipt.getshuru('form',['input']);
        if(ipt.checkinput(input)){
            let nr = ipt.gettext(input);
            shuju.set('password',nr.get('password'));
            shuju.set('phone',nr.get('phone'));
            shuju.set('method','denglu');
            shuju.getshuju('user',{
                success:function(data){
                    if(data.code==200){
                        mydata.set('info',data.data);
                        alert('登录成功');
                        window.location.href='index.html';
                    }else{
                        alert(data.data);
                    }
                },
                error:function(e){
                    alert('登录失败，请检查网络');
                }
            })

        }
    }

</script>
</html>
